package com.hqs.listener.fragment;

import android.support.v4.app.Fragment;

import com.hqs.listener.activity.MainActivity;
import com.hqs.listener.service.MusicService;

/**
 * Created by super on 2017/11/13.
 */

public class BaseFragment extends Fragment {

    MusicService service;


    @Override
    public void onStart() {
        super.onStart();
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (true){
                    if (service == null){
                        try {
                            Thread.sleep(300);
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        }
                        service = MainActivity.instance.service;
                    }
                    else{
                        didSetService();
                        break;
                    }
                }
            }
        }).start();
    }

    public void didSetService(){

    }

}
